package mybatis_ex4;

import java.util.HashMap;
import java.util.Map;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.imooc.bean.Message;
import com.imooc.dao.MessageMapper;

public class MybatisTest02 {
	private ApplicationContext applicationContext;

	@Before
	public void init() throws Exception {
		// 创建spring容器
		applicationContext = new ClassPathXmlApplicationContext("spring/applicationContext.xml");
	}

	@Test
	public void testmethod() throws Exception {
		MessageMapper messageMapper = (MessageMapper) applicationContext.getBean("messageMapper");
		int r = messageMapper.count(new Message());
		System.out.println(r);
		
	}
}
